﻿<Window x:Class="ApiScannerShell.EditTestConfigurationView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ViewModels="clr-namespace:ApiScannerShell.ViewModels" xmlns:ApiScannerShell="clr-namespace:ApiScannerShell" xmlns:Views="clr-namespace:ApiScannerShell.Views" Title="{Binding ViewModel.DisplayName, ElementName=Root}" x:Name="Root" 
        MinWidth="300" MinHeight="200" SizeToContent="WidthAndHeight" SnapsToDevicePixels="True" ResizeMode="NoResize" ShowInTaskbar="False">
	<Grid DataContext="{Binding ViewModel, ElementName=Root}" Grid.IsSharedSizeScope="true">
		<Grid.Resources>
			<ApiScannerShell:InvertBoolConverter x:Key="InvertBoolConverter" />
			<DataTemplate DataType="{x:Type ViewModels:ExchangeStoreScannerTestConfigurationElementViewModel}">
                <Views:ExchangeStoreScannerTestConfigurationElementEditView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type ViewModels:SmtpServerEventScannerTestConfigurationElementViewModelConfigurationElement}">
                <Views:SmtpServerEventScannerTestConfigurationElementEditView /> 
            </DataTemplate>
            <DataTemplate DataType="{x:Type ViewModels:FileSystemScannerTestConfigurationElementViewModel}">
                <Views:FileSystemScannerTestConfigurationElementEditView />
            </DataTemplate>
        </Grid.Resources>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<WrapPanel Orientation="Vertical" Grid.Row="0" Style="{StaticResource HeaderPanel}">
			<TextBlock Style="{StaticResource Heading}" Text="{Binding DisplayName}" />
			<TextBlock Style="{StaticResource SubHeading}" Text="{Binding Description}" />
		</WrapPanel>
		<DockPanel Grid.Row="1">
            <Grid DockPanel.Dock="Bottom">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="Header" />
                    <ColumnDefinition SharedSizeGroup="Settings" />
                </Grid.ColumnDefinitions>
                <TextBlock Style="{StaticResource Text}" Grid.Column="0" Text="Status:" />
                <WrapPanel Orientation="Vertical" Grid.Row="0" Grid.Column="1" >
					<RadioButton Style="{StaticResource RadioButton}" Content="This test is enabled" IsChecked="{Binding IsEnabled}" />
                    <RadioButton Style="{StaticResource RadioButton}" Content="This test is disabled" IsChecked="{Binding IsEnabled, Converter={StaticResource InvertBoolConverter}}" />
				</WrapPanel>
            </Grid>
			<ContentPresenter Content="{Binding}" />
		</DockPanel>
        <Grid Grid.Row="2" Style="{StaticResource FooterPanel}">
            <StackPanel Orientation="Horizontal"  HorizontalAlignment="Right">
                <Button Style="{StaticResource Button}" Command="{Binding SaveAndCloseCommand}" Content="Save and close" CommandParameter="{Binding ElementName=Root}" />
                <Button Style="{StaticResource Button}" Command="{Binding CancelAndCloseCommand}" Content="Cancel and close" CommandParameter="{Binding ElementName=Root}" />
            </StackPanel>
        </Grid>
       
	</Grid>
</Window>